package com.fish.common.jms;


import javax.jms.Topic;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.jms.core.JmsTemplate;


public class TopicMessageProducer {
	
	private static final Log log = LogFactory.getLog(TopicMessageProducer.class);
	
    private JmsTemplate template;

	private Topic destination;

	public void setTemplate(JmsTemplate template) {
		this.template = template;
	}

	public void setDestination(Topic destination) {
		this.destination = destination;
	}


    public void sendMsg(Message msg){
    	log.info(msg);
    	template.convertAndSend(this.destination, msg);
    }


}
